package com.azzcs.juc.demo5;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @Author: wzg
 * @Date: 2021/6/15 上午10:39
 */
public class Main {

    public static void main(String[] args) throws InterruptedException, ExecutionException {
        Q q = new Q();
        P p1 = new P(q,"p1");
        P p2 = new P(q,"p2");
        P p3 = new P(q,"p3");
        C c1 = new C(q,"c1");
        C c2 = new C(q,"c2");
        C c3 = new C(q,"c3");

        ExecutorService executor = Executors.newFixedThreadPool(10);
        executor.execute(p1);
        executor.execute(p2);
        executor.execute(p3);
        executor.execute(c1);
        executor.execute(c2);
        executor.execute(c3);

    }
}
